home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
- Begin VB.Form frmFind
- BorderStyle = 3 'Fixed Dialog
- Caption = "Find"
- ClientHeight = 3150
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 4530
- BeginProperty Font
- Name = "Tahoma"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Icon = "frmFind.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 3150
- ScaleWidth = 4530
- ShowInTaskbar = 0 'False
- StartUpPosition = 3 'Windows Default
- Begin VB.PictureBox picTabContainer
- Height = 2055
- Index = 3
- Left = 600
- ScaleHeight = 1995
- ScaleWidth = 3435
- TabIndex = 14
- Top = 3960
- Width = 3495
- Begin VB.Frame fraCode
- Caption = "Search Code:"
- Height = 1575
- Left = 120
- TabIndex = 15
- Top = 120
- Width = 3255
- Begin VB.CheckBox chkCase
- Caption = "&Case Sensitive"
- Height = 255
- Index = 1
- Left = 120
- TabIndex = 18
- Top = 1080
- Width = 2175
- End
- Begin VB.CheckBox chkMatchComplete
- Caption = "Match Complete String"
- Height = 255
- Index = 1
- Left = 120
- TabIndex = 17
- Top = 720
- Width = 2295
- End
- Begin VB.TextBox txtCode
- Height = 285
- Left = 120
- TabIndex = 16
- Top = 360
- Width = 1935
- End
- End
- End
- Begin VB.PictureBox picTabContainer
- Height = 2055
- Index = 2
- Left = 360
- ScaleHeight = 1995
- ScaleWidth = 3435
- TabIndex = 9
- Top = 3720
- Width = 3495
- Begin VB.Frame fraNotes
- Caption = "Search Notes:"
- Height = 1575
- Left = 120
- TabIndex = 10
- Top = 120
- Width = 3255
- Begin VB.CheckBox chkCase
- Caption = "&Case Sensitive"
- Height = 255
- Index = 0
- Left = 120
- TabIndex = 13
- Top = 1080
- Width = 2415
- End
- Begin VB.CheckBox chkMatchComplete
- Caption = "Match Complete String"
- Height = 255
- Index = 0
- Left = 120
- TabIndex = 12
- Top = 720
- Width = 2655
- End
- Begin VB.TextBox txtNotes
- Height = 285
- Left = 120
- TabIndex = 11
- Top = 360
- Width = 1935
- End
- End
- End
- Begin VB.PictureBox picTabContainer
- Height = 2055
- Index = 1
- Left = 240
- ScaleHeight = 1995
- ScaleWidth = 3435
- TabIndex = 3
- Top = 3480
- Width = 3495
- Begin VB.Frame fraItems
- Caption = "Search Items:"
- Height = 1695
- Left = 120
- TabIndex = 4
- Top = 120
- Width = 3255
- Begin VB.CheckBox chkMatch
- Caption = "Match Complete String"
- Height = 255
- Left = 120
- TabIndex = 8
- Top = 1200
- Width = 1935
- End
- Begin VB.OptionButton optEntire
- Caption = "Search entire tree"
- Height = 255
- Left = 120
- TabIndex = 7
- Top = 960
- Width = 2295
- End
- Begin VB.OptionButton optBranch
- Caption = "Search selected branch only"
- Height = 195
- Left = 120
- TabIndex = 6
- Top = 720
- Width = 3015
- End
- Begin VB.TextBox txtItems
- Height = 285
- Left = 120
- TabIndex = 5
- Top = 360
- Width = 1935
- End
- End
- End
- Begin VB.CommandButton cmdCancel
- Caption = "&Cancel"
- Height = 375
- Left = 3360
- TabIndex = 2
- Top = 2640
- Width = 1095
- End
- Begin VB.CommandButton cmdFind
- Caption = "&Find"
- Default = -1 'True
- Height = 375
- Left = 2160
- TabIndex = 1
- Top = 2640
- Width = 1095
- End
- Begin ComctlLib.TabStrip tbsTab
- Height = 2415
- Left = 120
- TabIndex = 0
- Top = 120
- Width = 4335
- _ExtentX = 7646
- _ExtentY = 4260
- _Version = 327682
- BeginProperty Tabs {0713E432-850A-101B-AFC0-4210102A8DA7}
- NumTabs = 3
- BeginProperty Tab1 {0713F341-850A-101B-AFC0-4210102A8DA7}
- Caption = "Search &Items"
- Key = ""
- Object.Tag = ""
- Object.ToolTipText = "Seach Items"
- ImageVarType = 2
- EndProperty
- BeginProperty Tab2 {0713F341-850A-101B-AFC0-4210102A8DA7}
- Caption = "Search &Notes"
- Key = ""
- Object.Tag = ""
- Object.ToolTipText = "Search Notes"
- ImageVarType = 2
- EndProperty
- BeginProperty Tab3 {0713F341-850A-101B-AFC0-4210102A8DA7}
- Caption = "Search &Code"
- Key = ""
- Object.Tag = ""
- Object.ToolTipText = "Search Code"
- ImageVarType = 2
- EndProperty
- EndProperty
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "Tahoma"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- End
- Attribute VB_Name = "frmFind"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- '----------------------------------------
- '- Name: Sam Huggill
- '- Email: sam@vbsquare.com
- '- Web: http://www.vbsquare.com/
- '- Company: Lighthouse Internet Solutions
- '- Date/Time: 14/08/99 11:32:26
- '----------------------------------------
- '- Notes: Find dialog
- '----------------------------------------
- Option Explicit
- '// Holds a reference to the number of tabs
- Private Const NumberOfTabs = 3
- Private Sub cmdCancel_Click()
- Unload Me
- End Sub
- Private Sub cmdFind_Click()
- '// Determine what the user is doing
- Select Case tbsTab.SelectedItem.Index
- Case 1 'Items
- FindItem txtItems, frmMain.tvwItems
- Case 2 'Notes
- modData.Key = frmMain.tvwItems.SelectedItem.Key
- If modData.FindNotes(txtNotes, frmMain.ctlFavourites1, frmMain.tvwItems) Then Unload Me
- Case 3 'Code
- FindCode txtCode, frmMain.tvwItems, frmMain.ctlData1
- Case Else
- End Select
- End Sub
- Private Sub Form_Load()
- Dim intX As Integer
- Dim blnTab As Boolean
- Dim intTabIndex As Integer
- For intX = 1 To NumberOfTabs
- With picTabContainer(intX)
- .BorderStyle = 0
- .left = tbsTab.ClientLeft
- .tOp = tbsTab.ClientTop
- .Width = tbsTab.ClientWidth
- .Height = tbsTab.ClientHeight
- .Visible = False
- End With
- Next intX
- '// Should we show the last used tab?
- blnTab = GetSetting(ThisApp, "General", "Remember Tabs", True)
- If blnTab = True Then
- intTabIndex = Val(GetSetting(ThisApp, "General", "Find", 1))
- 'Line Added by Peter L Henry
- If intTabIndex = 0 Then intTabIndex = 1
- tbsTab.Tabs(intTabIndex).Selected = True
- End If
- CentreForm Me
- '// Move the frames
- fraCode.Move ScaleLeft + 15, ScaleTop + 15, ScaleWidth - 15, ScaleHeight - 15
- fraItems.Move ScaleLeft + 15, ScaleTop + 15, ScaleWidth - 15, ScaleHeight - 15
- fraNotes.Move ScaleLeft + 15, ScaleTop + 15, ScaleWidth - 15, ScaleHeight - 15
- optEntire.Value = True
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- Dim intTabIndex As Integer
- Dim blnTab As Boolean
- '// Save the current tab
- blnTab = GetSetting(ThisApp, "General", "Remember Tabs", True)
- If blnTab = True Then
- SaveSetting ThisApp, "General", "Find", tbsTab.SelectedItem.Index
- End If
- End Sub
- Private Sub tbsTab_Click()
- Static PrevTab As Integer
- PrevTab = Switch(PrevTab = 0, 1, PrevTab >= 1 And PrevTab <= NumberOfTabs, PrevTab)
- picTabContainer(PrevTab).Visible = False
- picTabContainer(tbsTab.SelectedItem.Index).Visible = True
- picTabContainer(tbsTab.SelectedItem.Index).Refresh
- PrevTab = tbsTab.SelectedItem.Index
- DoEvents
- End Sub
- Public Sub FindItem(sText As String, tvw As TreeView)
- '// Seach the current branch: Only supports one level
- If optBranch = True Then
- If tvw.SelectedItem.Children = 0 Then
- MsgBox "The selected item has no children.", vbOKOnly + vbInformation
- Unload Me
- End If
- '// Set the key and find
- modData.Key = tvw.SelectedItem.Key
- If modData.FindBranch(tvw, txtItems, frmMain.ctlFavourites1, chkMatch.Value) Then
- Unload Me
- End If
- End If
- If optEntire = True Then 'Search entire tree
- If chkMatch.Value Then
- If modData.FindWhole(sText, frmMain.ctlFavourites1, frmMain.tvwItems) Then Unload Me
- Else
- If modData.FindPartX(sText, frmMain.ctlFavourites1, frmMain.tvwItems) Then Unload Me
- End If
- End If
- End Sub
- Sub FindCode(sText As String, tvw As TreeView, ctl As Object)
- If ctl.Find(sText) Then 'Found a match
- Unload Me
- End If
- End Sub
-